import axios from 'axios'
import {
  getCookie
} from '../utils/indes'
const newAxios = axios.create({
  baseURL: 'http://127.0.0.1:5000/api/',
  timeout: 5000
})
newAxios.interceptors.request.use(config => {
  // const token = window.sessionStorage.getItem('token')
  const token = getCookie('access_token')
  // if (token) {
  config.headers.Authorization = 'Bearer ' + token

  return config
  // }
})

export default newAxios
